package org.mobile.model.service.api;

import org.mobile.model.dao.ApiFlowJnlMapper;
import org.mobile.model.pojo.ApiFlowJnl;
import org.mobile.model.util.JSONUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.sf.json.JSONObject;

@Service
public class ApiFlowJnlService {
	@Autowired
    private ApiFlowJnlMapper apiFlowJnlMapper;

    public JSONObject addApiFlowJnl(JSONObject obj) {
        String data = obj.optString("data");
        obj.remove("data");
        ApiFlowJnl apiFlowJnl = JSONUtils.jsonToObject(obj, ApiFlowJnl.class);
        apiFlowJnl.setData(data);
        apiFlowJnlMapper.insertSelective(apiFlowJnl);
        return null;

    }

}
